package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.City;
import com.ruoyi.system.service.ISysProvincesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class SysProvincesController extends BaseController {
    // 测试
    @Autowired
    private ISysProvincesService provincesService;

    @GetMapping("/getProvince")
    @ResponseBody
    public List<City> getProvince(){
        return provincesService.selectProvince();
    }

    @GetMapping("/getCityById")
    @ResponseBody
    public List<City> getCityById(int fId){
        return provincesService.selectCityById(fId);
    }

    @GetMapping("/getRegionById")
    @ResponseBody
    public List<City> getRegionById(int fId){
        return provincesService.selectRegionById(fId);
    }


}
